USE [shop_v3]
GO

/****** Object:  StoredProcedure [dbo].[ps_detaillivre]    Script Date: 12/19/2012 14:26:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Loic Jacolin>
-- Create date: <18/12/2012>
-- Description:	<Fiche livre>
-- =============================================
ALTER PROCEDURE [dbo].[ps_detaillivre] @id INT
AS
BEGIN
	SET NOCOUNT ON;

SELECT L.LIV_ID, LIV_ISBN, LIV_TITRE, LIV_SOUSTITRE, LIV_PRIXHT, LIV_RESUME, LIV_DATEPUBLICATION, LIV_NBPAGES, AUT_NOM, AUT_PRENOM, LIV_STOCK, TVA_TAUX, EDI_NOM, GEN_LABEL, EVE_LABEL
FROM T_LIVRES L INNER JOIN T_TVA T
ON L.TVA_ID = T.TVA_ID
INNER JOIN T_EDITEURS E
ON L.EDI_ID = E.EDI_ID
INNER JOIN T_GENRES G
ON L.GEN_ID = G.GEN_ID
LEFT OUTER JOIN T_EVENTS EV
ON L.EVE_ID = EV.EVE_ID
LEFT OUTER JOIN TJ_AUTEURS_AUT AA
ON L.LIV_ID = AA.LIV_ID
LEFT OUTER JOIN T_AUTEURS A
ON AA.AUT_ID = A.AUT_ID
WHERE L.LIV_ID = @id

END

GO


